home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / less.arc / LESS.DOC next >
Encoding:
Text File  |  1986-08-13  |  13.5 KB  |  397 lines

  1.  
  2.  
  3.  
  4. LESS(l)             UNIX Programmer's Manual              LESS(l)
  5.  
  6.  
  7.  
  8. NAME
  9.      less - opposite of more
  10.  
  11. SYNOPSIS
  12.      less [-cdepstwmMqQuU] [-h_n] [-b[fp]_n] [-x_n] [-[z]_n] [+_c_m_d]
  13.      [_n_a_m_e] ...
  14.  
  15. DESCRIPTION
  16.      _L_e_s_s is a program similar to _m_o_r_e(1), but which allows back-
  17.      wards movement in the file as well as forward movement.
  18.      Also, _l_e_s_s does not have to read the entire input file
  19.      before starting, so with large input files it starts up fas-
  20.      ter than text editors like _v_i(1).  _L_e_s_s uses termcap, so it
  21.      can run on a variety of terminals.  There is even limited
  22.      support for hardcopy terminals.  (On a hardcopy terminal,
  23.      lines which should be printed at the top of the screen are
  24.      prefixed with an up-arrow.)
  25.  
  26.      Commands are based on both _m_o_r_e and _v_i.  Commands may be
  27.      preceeded by a decimal number, called N in the descriptions
  28.      below.  The number is used by some commands, as indicated.
  29.  
  30. COMMANDS
  31.      h    Help: display a summary of these commands.  If you for-
  32.           get all the other commands, remember this one.
  33.  
  34.      SPACE
  35.           Scroll forward N lines, default one window (see option
  36.           -z below).  If N is more than the screen size, only one
  37.           screenful is displayed.
  38.  
  39.      f    Same as SPACE.
  40.  
  41.      b    Scroll backward N lines, default one window (see option
  42.           -z below).  If N is more than the screen size, only one
  43.           screenful is displayed.
  44.  
  45.      RETURN
  46.           Scroll forward N lines, default 1.  If N is more than
  47.           the screen size, the entire N lines are displayed.
  48.  
  49.      e    Same as RETURN.
  50.  
  51.      j    Also the same as RETURN.
  52.  
  53.      y    Scroll backward N lines, default 1.  If N is more than
  54.           the screen size, the entire N lines are displayed.
  55.  
  56.      k    Same as y.
  57.  
  58.      d    Scroll forward N lines, default 10.  If N is specified,
  59.           it becomes the new default for all d and u commands.
  60.  
  61.  
  62.  
  63. Printed 8/13/86                                                 1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LESS(l)             UNIX Programmer's Manual              LESS(l)
  71.  
  72.  
  73.  
  74.      u    Scroll backward N lines, default 10.  If N is speci-
  75.           fied, it becomes the new default for all d and u com-
  76.           mands.
  77.  
  78.      r    Repaint the screen.
  79.  
  80.      R    Repaint the screen, discarding any buffered input.
  81.           Useful if the file is changing while it is being
  82.           viewed.
  83.  
  84.      g    Go to line N in the file, default 1 (beginning of
  85.           file).  (Warning: this may be slow if N is large.)
  86.  
  87.      G    Go to line N in the file, default the end of the file.
  88.           (Warning: this may be slow if standard input, rather
  89.           than a file, is being read.)
  90.  
  91.      p    Go to a position N percent into the file.  N should be
  92.           between 0 and 100.  (This is possible if standard input
  93.           is being read, but only if _l_e_s_s has already read to the
  94.           end of the file.  It is always fast, but not always
  95.           useful.)
  96.  
  97.      %    Same as p.
  98.  
  99.      m_l   Followed by any lowercase letter, _l, marks the current
  100.           position with that letter.
  101.  
  102.      '_l   Followed by any lowercase letter, _l, returns to the
  103.           position which was previously marked with that letter.
  104.           All marks are lost when a new file is examined.
  105.  
  106.      /pattern
  107.           Search forward in the file for the N-th occurence of
  108.           the _p_a_t_t_e_r_n.  N defaults to 1.  The _p_a_t_t_e_r_n is a regu-
  109.           lar expression, as recognized by _e_d.  The search starts
  110.           at the second line displayed (but see the -t option,
  111.           which changes this).
  112.  
  113.      ?pattern
  114.           Search backward in the file for the N-th occurence of
  115.           the _p_a_t_t_e_r_n.  The search starts at the line immediately
  116.           before the top line displayed.
  117.  
  118.      n    Repeat previous search, for N-th occurence of the last
  119.           _p_a_t_t_e_r_n.
  120.  
  121.      E [_f_i_l_e_n_a_m_e]
  122.           Examine a new file.  If the _f_i_l_e_n_a_m_e is missing, the
  123.           "current" file (see the N and P commands below) from
  124.           the list of files in the command line is re-examined.
  125.  
  126.  
  127.  
  128.  
  129. Printed 8/13/86                                                 2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. LESS(l)             UNIX Programmer's Manual              LESS(l)
  137.  
  138.  
  139.  
  140.      N    Examine the next file (from the list of files given in
  141.           the command line).  If a number N is specified (not to
  142.           be confused with the command N), the N-th next file is
  143.           examined.
  144.  
  145.      P    Examine the previous file.  If a number N is specified,
  146.           the N-th previous file is examined.
  147.  
  148.      =    Prints the name of the file being viewed and the byte
  149.           offset of the bottom line being displayed.  If possi-
  150.           ble, it also prints the length of the file and the per-
  151.           cent of the file above the last displayed line.
  152.  
  153.      -    Followed by one of the command line option letters (see
  154.           below), this will toggle the setting of that option and
  155.           print a message describing the new setting.
  156.  
  157.      V    Prints the version number of _l_e_s_s being run.
  158.  
  159.      q    Exits _l_e_s_s.
  160.  
  161.      The following two commands may or may not be valid, depend-
  162.      ing on your particular installation.
  163.  
  164.      v    Invokes an editor to edit the current file being
  165.           viewed.  The editor is taken from the environment vari-
  166.           able EDITOR, or defaults to _v_i.
  167.  
  168.      ! _s_h_e_l_l-_c_o_m_m_a_n_d
  169.           Invokes a shell to run the _s_h_e_l_l-_c_o_m_m_a_n_d given.
  170.  
  171. OPTIONS
  172.      Command line options are described below.  Options are also
  173.      taken from the environment variable LESS.  (The environment
  174.      variable is parsed before the command line, so command line
  175.      options override the LESS environment variable.  Options may
  176.      be changed while _l_e_s_s is running via the "-" command.)  For
  177.      example, if you like more-style prompting, to avoid typing
  178.      less -m ... each time _l_e_s_s is invoked, you might tell _c_s_h:
  179.  
  180.      setenv LESS m
  181.  
  182.      or if you use _s_h:
  183.  
  184.      LESS=m; export LESS
  185.  
  186.      -s   The -s flag causes consecutive blank lines to be
  187.           squeezed into a single blank line.  This is useful when
  188.           viewing _n_r_o_f_f output.
  189.  
  190.      -t   Normally, forward searches start just after the top
  191.           displayed line (that is, at the second displayed line).
  192.  
  193.  
  194.  
  195. Printed 8/13/86                                                 3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. LESS(l)             UNIX Programmer's Manual              LESS(l)
  203.  
  204.  
  205.  
  206.           Thus forward searches include the currently displayed
  207.           screen.  The -t command line option causes forward
  208.           searches to start just after the bottom line displayed,
  209.           thus skipping the currently displayed screen.
  210.  
  211.      -m   Normally, _l_e_s_s prompts with a colon.  The -m command
  212.           line option causes _l_e_s_s to prompt verbosely like _m_o_r_e,
  213.           printing the file name and percent into the file.
  214.  
  215.      -M   The -M command line option causes _l_e_s_s to prompt even
  216.           more verbosely than _m_o_r_e.
  217.  
  218.      -q   Normally, if an attempt is made to scroll past the end
  219.           of the file or before the beginning of the file, the
  220.           terminal bell is rung to indicate this fact.  The -q
  221.           command line option tells _l_e_s_s not to ring the bell at
  222.           such times.  If the terminal has a "visual bell", it is
  223.           used instead.
  224.  
  225.      -Q   Even if -q is given, _l_e_s_s will ring the bell on certain
  226.           other errors, such as typing an invalid character.  The
  227.           -Q command line option tells _l_e_s_s to be quiet all the
  228.           time; that is, never ring the terminal bell.  If the
  229.           terminal has a "visual bell", it is used instead.
  230.  
  231.      -e   Normally the only way to exit less is via the "q" com-
  232.           mand.  The -e command line option tells less to
  233.           automatically exit the second time it reaches end-of-
  234.           file.
  235.  
  236.      -u   If the -u command line option is given, backspaces are
  237.           treated as printable characters; that is, they are sent
  238.           to the terminal when they appear in the input.
  239.  
  240.      -U   If the -U command line option is given, backspaces are
  241.           printed as the two character sequence "^H".  If neither
  242.           -u nor -U is given, backspaces which appear adjacent to
  243.           an underscore character or sequences of a character
  244.           interleaved with backspaces are treated specially:  the
  245.           underlined or boldfaced text is displayed using the
  246.           terminal's hardware capability.  Note that the -v
  247.           option below superceeds both -u and -U.
  248.  
  249.      -w   Normally, _l_e_s_s uses a tilde character to represent
  250.           lines past the end of the file.  The -w option causes
  251.           blank lines to be used instead.
  252.  
  253.      -d   Normally, _l_e_s_s will complain if the terminal is dumb;
  254.           that is, lacks some important capability, such as the
  255.           ability to clear the screen or scroll backwards.  The
  256.           -d flag suppresses this complaint (but does not other-
  257.           wise change the behavior of the program on a dumb
  258.  
  259.  
  260.  
  261. Printed 8/13/86                                                 4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. LESS(l)             UNIX Programmer's Manual              LESS(l)
  269.  
  270.  
  271.  
  272.           terminal).
  273.  
  274.      -p   Normally, _l_e_s_s will repaint the screen by scrolling
  275.           from the bottom of the screen.  If the -p flag is set,
  276.           when _l_e_s_s needs to change the entire display, it will
  277.           clear the screen and paint from the top line down.
  278.  
  279.      -h_n  Normally, _l_e_s_s will scroll backwards when backwards
  280.           movement is necessary.  The -h option specifies a max-
  281.           imum number of lines to scroll backwards.  If it is
  282.           necessary to move backwards more than this many lines,
  283.           the screen is repainted in a forward direction.  (If
  284.           the terminal does not have the ability to scroll back-
  285.           wards, -h_0 is implied.)
  286.  
  287.      -[z]_n
  288.           When given a backwards or forwards window command, _l_e_s_s
  289.           will by default scroll backwards or forwards one
  290.           screenful of lines.  The -z option changes the default
  291.           scrolling window size to _n lines.  If _n is greater than
  292.           the screen size, the scrolling window size will be set
  293.           to one screenful.  Note that the z is optional for com-
  294.           patibility with more.
  295.  
  296.      -x   The -x command line option sets tab stops every _n posi-
  297.           tions.  The default for _n is 8.
  298.  
  299.      -b[fp]_n
  300.           The -b command line option tells _l_e_s_s to use a non-
  301.           standard buffer size.  There are two standard (default)
  302.           buffer sizes, one is used when a file is being read and
  303.           the other when a pipe (standard input) is being read.
  304.           The current defaults are 5 buffers for files and 12 for
  305.           pipes.  (Buffers are 1024 bytes.)  The number _n speci-
  306.           fies a different number of buffers to use.  The -b may
  307.           be followed by f, in which case only the file default
  308.           is changed, or by p in which case only the pipe default
  309.           is changed.  Otherwise, both are changed.
  310.  
  311.      -c   Normally, when data is read by _l_e_s_s, it is scanned to
  312.           ensure that bit 7 (the high order bit) is turned off in
  313.           each byte read, and to ensure that there are no null
  314.           (zero) bytes in the data (null bytes are turned into
  315.           "@" characters).  If the data is known to be "clean",
  316.           the -c command line option will tell _l_e_s_s to skip this
  317.           checking, causing an imperceptible speed improvement.
  318.           (However, if the data is not "clean", unpredicatable
  319.           results may occur.)
  320.  
  321.      -v   The -v option tells less to print non-printing charac-
  322.           ters in a visible way ala _c_a_t(1).  Control characters
  323.           are printed as ^X (the delete character (octal 0177) is
  324.  
  325.  
  326.  
  327. Printed 8/13/86                                                 5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. LESS(l)             UNIX Programmer's Manual              LESS(l)
  335.  
  336.  
  337.  
  338.           printed as ^?).  Characters with the 0200 bit set are
  339.           printed as M- followed by the character represented by
  340.           the low order seven bits.
  341.  
  342.      +_c_o_m_m_a_n_d
  343.           If a command line option begins with +, the remainder
  344.           of that option is taken to be an initial command to
  345.           _l_e_s_s.  For example, +_G tells _l_e_s_s to start at the end
  346.           of the file rather than the beginning, and +/_x_y_z tells
  347.           it to start at the first occurence of _x_y_z in the file.
  348.           As a special case, +<_n_u_m_b_e_r> acts like +<_n_u_m_b_e_r>_g; that
  349.           is, it starts the display at the specified line number
  350.           (however, see the caveat under the g command above).
  351.           If the option starts with ++, the initial command
  352.           applies to every file being viewed, not just the first
  353.           one.
  354.  
  355. BUGS
  356.      When used on standard input (rather than a file), you can
  357.      move backwards only a finite amount, corresponding to that
  358.      portion of the file which is still buffered.
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393. Printed 8/13/86                                                 6
  394.  
  395.  
  396.  
  397.